import { ref } from 'vue'
import { defineStore } from 'pinia'

export const useWorkStore = defineStore('work', () => {
    // state
    const workInfo = ref()

    //获取admin信息
    const getWorkInfo = ()=> { 
        return workInfo.value
    }
    const setWorkInfo = (work) => {
        workInfo.value = work
    }
    return {
        workInfo,
        getWorkInfo,
        setWorkInfo
    }  
}
,
{
    // 网页端的配置
    // persist: true,
    // 小程序端的配置
    persist: {
      storage: {
        getItem: (key) => uni.getStorageSync(key),
        setItem: (key, value) => uni.setStorageSync(key, value)
      },
    },
},

)